#!/bin/bash
########################################################################
# script name:  check_mksysb.sh
# Used for:
# Author:       Martin Dumont
# Contributors:
# Version:      0.1
#
# (date format: date +'%Y/%m/%d')
#
# Date          Version Contributors    Modifications
# ----------    ------- ------------    -------------
# 2012/01/11    0.1     MDUMONT         initial
########################################################################
#set -vx 
export SERVER=$1
DIR=`dirname $0`
MKSYSBDIR=$(cd $DIR/../mksysb; pwd)
if [[ ! -d "$MKSYSBDIR" ]]; then echo "Mksysb direcotry doesn't exist"; exit 1; fi
MKSYSFILE=$(ls -tr $MKSYSBDIR/${SERVER}*.mksysb | tail -1)
if [[ ! -f $MKSYSFILE ]]; then echo No mksysfile present; exit 1; fi
echo The following mysysb backup for host $SERVER has been saved in file $MKSYSFILE
echo " "
lsmksysb -lf $MKSYSFILE
